package net.aiion.weave.spi.messaging.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * This annotation may be used on message types. The message annotated by this annotation type is directly submitted to
 * the {@link net.aiion.weave.spi.naming.annotations.Named} object bound by the name denoted by the value of this annotation.
 * Otherwise the message is broadcasted into the {@link net.aiion.weave.spi.naming.Context} to
 * {@link net.aiion.weave.spi.naming.annotations.Named} objects ready for receiving it.
 * 
 * @see net.aiion.weave.spi.messaging.MessageService
 * @see net.aiion.weave.spi.messaging.MessageQueue
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Recipient
{
    /**
     * This attribute denotes the message addressee's binding name in a
     * {@link net.aiion.weave.spi.naming.Context}.
     */
    String value();
}
